Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--com.pacist.diamonds.DiamondCanvas | +--com.pacist.diamonds.Controller
Field Summary | |
boolean | canMeasure
|
java.util.Vector | listeners
|
int | maxValue
|
int | minValue
|
boolean | postOnMouseDown
|
boolean | postWhileDragging
|
boolean | showValue
|
int | value
|
Fields inherited from class com.pacist.diamonds.DiamondCanvas | |
tipText |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Constructor Summary | |
Controller()
Creates and initializes a new Controller object. |
|
Controller(int min,
int max,
int initial)
Creates and initializes a new Controller object with the specified minimum, maximum, and initial values. |
Method Summary | |
void | addControllerListener(ControllerListener l)
Adds the specified Controller listener to receive Controller events from this Controller. |
int | getMaxValue()
Gets the maximum value of the controller. |
int | getMinValue()
Gets the minimum value of the controller. |
boolean | getPostOnMouseDown()
Determines whether an event will be posted when the mouse is pressed down. |
boolean | getShowValue()
Gets the show value of the controller. |
int | getValue()
Gets the value of the controller. |
java.lang.String | getValueString(int v)
Gets the value of the controller as a string. |
boolean | isMaxAtBottom()
Determines whether the maximum is set to be at the bottom or not. |
boolean | mouseDragged(java.awt.event.MouseEvent event,
int x,
int y)
Method called when the mouse has been dragged. |
boolean | mousePressed(java.awt.event.MouseEvent event,
int x,
int y)
Method called when the mouse has been pressed. |
boolean | mouseReleased(java.awt.event.MouseEvent event,
int x,
int y)
Method called when the mouse has been released. |
void | notifyValueChange()
Notify all Controller listeners that there has been a value change. |
int | pinValue(int x)
Given a value x, will return minValue >= x =< maxValue. |
int | pointToValue(int x,
int y)
Calculates the value from a point. |
void | processMouseEvent(java.awt.event.MouseEvent e)
Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.
|
void | processMouseMotionEvent(java.awt.event.MouseEvent e)
Processes mouse motion events occurring on this component by dispatching them to any registered MouseMotionListener objects.
|
void | removeControllerListener(ControllerListener l)
Removes the specified Controller listener so that it no longer receives ControllerEvents from this Controller. |
void | setMaxAtBottom(boolean b)
Sets the maximum to appear at the bottom. |
void | setMaxValue(int val)
Sets the maximum value of the controller, and then repaints. |
void | setMinValue(int val)
Sets the minimum value of the controller, and then repaints. |
void | setPostOnMouseDown(boolean b)
Sets the controller to post an event when the mouse is pressed down. |
void | setShowValue(boolean val)
Sets the show value of the controller, and then repaints. |
void | setValue(int v)
Sets the value of the controller, causing it to be redrawn. |
Methods inherited from class com.pacist.diamonds.DiamondCanvas | |
getTipText, mouseEnter, mouseExit, processMouseEvent, setTipText |
Methods inherited from class java.awt.Canvas | |
addNotify, paint |
Methods inherited from class java.awt.Component | |
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paint, paramString, postEvent, preferredSize, prepareImage, prepareImage, printAll, print, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate |
Methods inherited from class java.lang.Object | |
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait |
Field Detail |
protected int minValue
protected int maxValue
protected int value
protected java.util.Vector listeners
protected boolean showValue
protected boolean canMeasure
protected boolean postWhileDragging
protected boolean postOnMouseDown
Constructor Detail |
public Controller()
public Controller(int min, int max, int initial)
min
- the minimum value of the controller.
max
- the maximum value of the controller.
initial
- the initial value of the controller.Method Detail |
public void setValue(int v)
v
- the new value.public int getValue()
public void setMaxAtBottom(boolean b)
public boolean isMaxAtBottom()
true
if the maximum is set to be at the bottom; false
otherwise.public java.lang.String getValueString(int v)
public void setMinValue(int val)
val
- the new minimum value.public int getMinValue()
public void setMaxValue(int val)
val
- the new maximum value.public int getMaxValue()
public boolean getShowValue()
public void setShowValue(boolean val)
val
- the new show value.public void setPostOnMouseDown(boolean b)
b
- true
- an event will be posted; false
otherwise.public boolean getPostOnMouseDown()
true
if an event will be posted; false
otherwise.public void addControllerListener(ControllerListener l)
public void removeControllerListener(ControllerListener l)
protected int pointToValue(int x, int y)
x
- the x coordinate.
y
- the y coordinate.protected int pinValue(int x)
protected void processMouseEvent(java.awt.event.MouseEvent e)
MouseListener
objects.
This method is not called unless mouse events are enabled for this component. Mouse events are enabled when one of the following occurs:
MouseListener
object is registered
via addMouseListener
.
enableEvents
.
e
- the mouse event.protected void processMouseMotionEvent(java.awt.event.MouseEvent e)
MouseMotionListener
objects.
This method is not called unless mouse motion events are enabled for this component. Mouse motion events are enabled when one of the following occurs:
MouseMotionListener
object is registered
via addMouseMotionListener
.
enableEvents
.
e
- the mouse motion event.public boolean mousePressed(java.awt.event.MouseEvent event, int x, int y)
event
- the mouse event.
x
- the x coordinate.
y
- the y coordinate.public boolean mouseDragged(java.awt.event.MouseEvent event, int x, int y)
event
- the mouse event.
x
- the x coordinate.
y
- the y coordinate.public boolean mouseReleased(java.awt.event.MouseEvent event, int x, int y)
event
- the mouse event.
x
- the x coordinate.
y
- the y coordinate.protected void notifyValueChange()
Overview | Package | Class | Tree | Deprecated | Index | Help | |||
PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |